import 'package:flutter/material.dart';
import 'package:drm/resource/string_resource.dart';

/*
 * 组件库 <br/>
 * 用于创建常用的组件<br/>
 */
class WidgetCreator {
  /*
   * 创建公有网络进度栏<br/>
   */
  static Widget createCommonProgressBar(
      {String text = StringRes.progressbar_text}) {
    Widget progressBar = Container(
      decoration: BoxDecoration(
          color: Color.fromARGB(127, 127, 127, 127),
         ),
      child: Column(
        children: <Widget>[
          Expanded(
            child:Container(),
            flex: 1,
          ),
          Container(
              height: 100,
              width: 100,
              child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    CircularProgressIndicator(),
                    SizedBox(
                      height: 10,
                    ),
                    Text(
                      StringRes.progressbar_text,
                      style: TextStyle(
                          color: Colors.black,
                          fontSize: 14,
                          decoration: TextDecoration.none),
                    )
                  ])),
          Expanded(
            child:Container(),
            flex: 1,
          ),
        ],
      ),
    );

    return progressBar;
  }
}
